package com.tbs.parkingsaleapp.UI.Listenners;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.Toast;
import com.tbs.parkingsaleapp.SystemManager.SystemDataMananger;
import com.tbs.parkingsaleapp.UI.LoginOrSign.LoginOrSign;

public class LoginNeed implements View.OnClickListener {
    Context context;
    public  LoginNeed(Context context)
    {
        this.context=context;
    }
    @Override
    public void onClick(View v) {
        if(SystemDataMananger.isLogined())
        {
            SystemDataMananger.OutLogin(context);
            Toast.makeText(context,"已登出",Toast.LENGTH_SHORT).show();
        }
        else
        {
            Intent intent=new Intent();
            intent.setClass(context, LoginOrSign.class);
            context.startActivity(intent);
        }

    }
}
